Quicksort Algorithm Again Revisited
نویسندگان
چکیده
We consider the standard Quicksort algorithm that sorts n distinct keys with all possible n! orderings of keys being equally likely. Equivalently, we analyze the total path length n in a randomly built binary search tree. Obtaining the limiting distribution of n is still an outstanding open problem. In this paper, we establish an integral equation for the probability density of the number of comparisons n. Then, we investigate the large deviations of n. We shall show that the left tail of the limiting distribution is much “thinner” (i.e., double exponential) than the right tail (which is only exponential). Our results contain some constants that must be determined numerically. We use formal asymptotic methods of applied mathematics such as the WKB method and matched asymptotics.
منابع مشابه
Quicksort Revisited - Verifying Alternative Versions of Quicksort
We verify the correctness of a recursive version of Tony Hoare’s quicksort algorithm using the Hoare-logic based verification tool Dafny. We then develop a non-standard, iterative version which is based on a stack of pivot-locations rather than the standard stack of ranges. We outline an incomplete Dafny proof for the latter.
متن کاملAverage Case and Distributional Analysis of Java 7's Dual Pivot Quicksort
In 2009, Oracle replaced the long-serving sorting algorithm in its Java 7 runtime library by a new dual pivot Quicksort variant due to Yaroslavskiy. The decision was based on the strikingly good performance of Yaroslavskiy’s implementation in running time experiments. At that time, no precise investigations of the algorithm were available to explain its superior performance — on the contrary: P...
متن کاملAnalysis of Linear Time Sorting Algorithms
We derive CPU time formulae for the two simplest linear time-sorting algorithms, linear probing sort and bucket sort, as a function of the load factor, and show agreement with experimentally measured CPU times. This allows us to compute optimal load factors for each algorithm, whose values have previously been identified only approximately in the literature. We also present a simple model of ca...
متن کاملQuicksort with median of medians is considered practical
Quicksort[2, 1, 3] is one of the most efficient and widely used sorting algorithms. The major drawback of quicksort is that worst case time complexity of naive implementations of quicksort is O(n2) with input size n. In order to avoid this worst case behavior, a variant of quicksort, so-called introsort[4] 1 , is often used. There exists another solution to keep the worst case complexity of qui...
متن کاملExploiting Partial Order with Quicksort
The widely known Quicksort algorithm does not attempt to actively take advantage of partial order in sorting data. A relatively simple change can be made to the Quicksort strategy to give a bestcase performance of n. for ordered data. with a smooth transition to O(n log n) for the random data case. An attractive attribute of this new algorithm CTransort> Is that its performance for random data ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Discrete Mathematics & Theoretical Computer Science
دوره 3 شماره
صفحات -
تاریخ انتشار 1999